#define  _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
int MD[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
using namespace std;
bool check(char tmp[10])
{
    for (int i = 0; i + 2 <= 7; i++)
    {
        if (tmp[i + 1] == tmp[i] + 1 && tmp[i + 2] == tmp[i] + 2)
            return true;
    }
    return false;
}
int main()
{
    int ret = 0;
    //int y = 2022;
    int month = 1;
    int day = 0;
    for (int i = 1; i <= 365; i++)
    {
        day++;

        char tmp[10] = { 2,0,2,2 };
        while (day > MD[month])
        {
            day = 1;
            month++;
        }
        if (month > 9)
        {
            tmp[4] = 1;
            tmp[5] = month - 10;
        }
        else {
            tmp[4] = 0;
            tmp[5] = month;
        }
        if (day > 9)
        {
            tmp[6] = day / 10;
            tmp[7] = day % 10;
        }
        else {
            tmp[6] = 0;
            tmp[7] = day;
        }

        if (check(tmp))
        {
            ret++;
        }
    }
    cout << ret << endl;
    return 0;
}